package cn.yuanqiao.archive.liyong.domain;

import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * 预约单实体
 *
 * @ProjectName: cn.yuanqiao.archive.liyong.domain
 * @ClassName: AppointmentForm
 * @Author: lenovo
 * @Description: hbWang
 * @Date: 2024/10/29 17:02
 * @Version: 1.0
 **/
public class AppointmentForm extends BaseEntity {

    public static final String BIGTABLENAME = "_APPOINTMENT_FORM";

    public AppointmentForm() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            throw new ServiceException("TenantCode is null");
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }
    private String tableName;
    /**
     * 主键
     */
    private Long id;

    /** 档案id */
    private String daId;

    /** 档案类型 */
    private String daType;

    /** 分表名 */
    private String subTableName;

    /** 档号 */
    private String dh;

    /** 日期 */
    private String rq;

    /** 保管期限 */
    private String bgqx;

    /** 题名 */
    private String title;

    /** 档案id集合 */
    private String daIds;

    /** 预约人id */
    private Long userId;

    /** 预约人名称 */
    private String userName;

    /** 部门id */
    private Long deptId;

    /** 部门名称 */
    private String deptName;

    /** 联系方式 */
    private String phone;

    /** 预约时间 */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date appointmentDate;

    /** 借阅时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date borrowTime;

    /** 状态  0 生效  1 失效 2 已借阅  3 未提交*/
    private String status;

    /** 创建人id */
    private Long createId;

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDaId() {
        return daId;
    }

    public void setDaId(String daId) {
        this.daId = daId;
    }

    public String getDaType() {
        return daType;
    }

    public void setDaType(String daType) {
        this.daType = daType;
    }

    public String getSubTableName() {
        return subTableName;
    }

    public void setSubTableName(String subTableName) {
        this.subTableName = subTableName;
    }

    public String getDh() {
        return dh;
    }

    public void setDh(String dh) {
        this.dh = dh;
    }

    public String getRq() {
        return rq;
    }

    public void setRq(String rq) {
        this.rq = rq;
    }

    public String getBgqx() {
        return bgqx;
    }

    public void setBgqx(String bgqx) {
        this.bgqx = bgqx;
    }

    public String getDaIds() {
        return daIds;
    }

    public void setDaIds(String daIds) {
        this.daIds = daIds;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Date getAppointmentDate() {
        return appointmentDate;
    }

    public void setAppointmentDate(Date appointmentDate) {
        this.appointmentDate = appointmentDate;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Long getCreateId() {
        return createId;
    }

    public void setCreateId(Long createId) {
        this.createId = createId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Date getBorrowTime() {
        return borrowTime;
    }

    public void setBorrowTime(Date borrowTime) {
        this.borrowTime = borrowTime;
    }

    @Override
    public String toString() {
        return "AppointmentForm{" +
                "id=" + id +
                ", daId='" + daId + '\'' +
                ", daType='" + daType + '\'' +
                ", subTableName='" + subTableName + '\'' +
                ", dh='" + dh + '\'' +
                ", rq='" + rq + '\'' +
                ", bgqx='" + bgqx + '\'' +
                ", title='" + title + '\'' +
                ", daIds='" + daIds + '\'' +
                ", userId=" + userId +
                ", userName='" + userName + '\'' +
                ", deptId=" + deptId +
                ", deptName='" + deptName + '\'' +
                ", phone='" + phone + '\'' +
                ", appointmentDate=" + appointmentDate +
                ", borrowTime=" + borrowTime +
                ", status='" + status + '\'' +
                ", createId=" + createId +
                '}';
    }
}
